<template>
  <div class="watersource-container">
    <div class="watersource-main">
      <div class="watersource-info">
        <div>{{ props.waterData.menuName }}</div>
        <div>
          <el-icon @click="closeClick">
            <Close />
          </el-icon>
        </div>
      </div>
      <div style="height: 100%">
        <el-input v-model="inputValue" size="small" class="w-50 m-2">
          <template #prefix>
            <el-icon class="el-input__icon" @click="searchClick">
              <search />
            </el-icon>
          </template>
        </el-input>

        <div style="padding: 0 10px; height: 90%; overflow: auto">
          <div
            v-for="(item, index) in dataList"
            v-show="
              props.waterData.menuName != '消火栓' &&
              props.waterData.menuName != '泡沫栓' &&
              props.waterData.menuName != '固定水炮' &&
              props.waterData.menuName != '固定泡沫炮'
            "
            :key="index"
            class="xfsgw-item"
            :class="{ 'active-color': activeIndex == item.id }"
            @click="clickHandler(item)"
          >
            <div style="display: flex; justify-content: space-between">
              <div v-if="props.waterData.menuName == '消防水管网'" class="overhidden" :title="item.xfsgwmc">{{ item.xfsgwmc }} </div>
              <div v-else-if="props.waterData.menuName == '消防泡沫管网'" class="overhidden" :title="item.xfpmgwmc">{{
                item.xfpmgwmc
              }}</div>
              <div v-else class="overhidden" :title="item.bzmc">{{ item.bzmc }}</div>
              <div style="line-height: 54px">
                <div style="display: flex">
                  <div
                    style="width: 20px; height: 20px; cursor: pointer"
                    @click="showDialog(item, 1)"
                  >
                    <img
                      style="width: 100%; height: 100%"
                      src="/src/assets/image/fire/编辑.png"
                      alt=""
                    />
                  </div>

                  <div
                    style="width: 20px; height: 20px; cursor: pointer; margin-left: 5px"
                    @click="removeClick(item, 2)"
                  >
                    <img
                      style="width: 100%; height: 100%"
                      src="/src/assets/image/fire/删除.png"
                      alt=""
                    />
                  </div>
                </div>
              </div>
            </div>
          </div>

          <div
            v-for="(item, index) in filPersons"
            v-show="
              props.waterData.menuName == '消火栓' ||
              props.waterData.menuName == '泡沫栓' ||
              props.waterData.menuName == '固定水炮' ||
              props.waterData.menuName == '固定泡沫炮'
            "
            :key="index"
            class="xfsgw-item"
            :class="{ 'active-color': activeIndex == item.id }"
            @click="clickHandler(item)"
          >
            <div style="display: flex; justify-content: space-between">
              <span>{{ item.searchMc }}</span>
              <div style="line-height: 54px">
                <div style="display: flex">
                  <div
                    style="width: 20px; height: 20px; cursor: pointer"
                    @click="showDialog(item, 1)"
                  >
                    <img
                      style="width: 100%; height: 100%"
                      src="/src/assets/image/fire/编辑.png"
                      alt=""
                    />
                  </div>

                  <div
                    style="width: 20px; height: 20px; cursor: pointer; margin-left: 5px"
                    @click="removeClick(item, 2)"
                  >
                    <img
                      style="width: 100%; height: 100%"
                      src="/src/assets/image/fire/删除.png"
                      alt=""
                    />
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <formInput
      v-if="isform"
      ref="dthhtrthr"
      :water-data="props.waterData"
      :xfbfxx-list="XfbfxxList"
      :dianwei-list="dianweiList"
      :blxoptions="blxoptions"
      :dllxoptions="dllxoptions"
      :symsoptions="symsoptions"
      :pmblhhoptions="pmblhhoptions"
      :lastxfs="lastxfs"
      :lastpms="lastpms"
      :lastgdsp="lastgdsp"
      :lastgdpmp="lastgdpmp"
      @cancelClick="cancelClick"
      @updateList="updateList"
    >
    </formInput>
    <!-- 删除数据二次确认弹窗 -->
    <SecondaryConfirm @secondaryConfirmSave="secondaryConfirmSave" />
  </div>
</template>

<script setup lang="ts">
import { defineExpose } from 'vue'
import { queryxfssDdByQyId } from '@/service/api'
import { chemical_server } from '@/service'
import {
  upDateXfbfxx,
  upDatepmz,
  upDatexfsy,
  upDatezrsy,
  upDatxfsgwxx,
  upDatxfpaomgw,
  upDatpms,
  upDatgdsp,
  upDatgdpmp,
} from '@/service/api'
import { queryxfsgwdd, queryxfpmgw, queryXfsgwxx, queryXfpm } from '@/service/api'
import { Close, Search } from '@element-plus/icons-vue'
import { removeMapFactor, flyToLxOrCjid } from '@/utils/common/index'
import formInput from '../formInput/index.vue'
import { clearEditState } from '@/utils/common/index'
import { useChemicalStore } from '@/store'
import { usezhezaocStore } from '@/store'
import SecondaryConfirm from '@/components/SecondaryConfirm/index.vue'
const chemicalStore = useChemicalStore()
const data = usezhezaocStore()
const props = defineProps<{
  waterData: any
}>()
const blxoptions = ref()
const dllxoptions = ref()
const symsoptions = ref()
const syztoptions = ref()
const pmblhhoptions = ref()
const dthhtrthr = ref()
const inputValue = ref('')
const activeIndex = ref('') //当前tab选中项
const dataList = ref([] as any)
const isform = ref(false)
const emit = defineEmits(['closeClick'])
const XfbfxxList = ref({
  wzxxbInfo: {},
  fzrxxInfo: {},
  xfbxxInfoList: [],
  sfyx: 1,
  fzrxxInfoList: [
    {
      bz: '',
      cjr: '',
      cjsj: '',
      gxr: '',
      gxsj: '',
      id: '',
      qyid: '',
      rymc: '',
      rysx: 0,
      ryyddh: '',
      ryzbdh: '',
      ryzw: '',
      sfyx: 0,
      ssid: '',
    },
  ],
})
interface ResultType {
  result: {
    resultCode: string
    resultMessage: string
  }
  data: object
}
const secondaryConfirmSave = (type: any, typeCode: any) => {
  const item: any = chemicalStore.secondaryConfirmInfo.data
  inputValue.value = ''
  /** 删除对应地图要素Start */
  const overlayArr = ['17', '18', '19', '20']
  const pointArr = ['21', '22', '23', '24']
  if (overlayArr.includes(item.bzlx)) {
    removeMapFactor(item.cjid, 'overlay')
  } else if (pointArr.includes(item.bzlx)) {
    removeMapFactor(item.cjid, 'point')
  }
  /** 删除对应地图要素 End */
  const params = {
    sfyx: 0,
    id: item.cjid,
    qyid: qyId.value,
  }
  if (props.waterData.menuId == 'ys00101') {
    const param = {
      sfyx: 0,
      id: item.id,
      qyid: qyId.value,
    }
    upDatxfsgwxx(param).then((res: any) => {
      updateList()
      cancelClick
    })
  } else if (props.waterData.menuId == 'ys00102') {
    const param = {
      sfyx: 0,
      id: item.id,
      qyid: qyId.value,
    }
    upDatxfpaomgw(param).then((res: any) => {
      updateList()
      cancelClick
    })
  } else if (props.waterData.menuId == 'ys00103') {
    upDateXfbfxx(params).then((res: any) => {
      updateList()
      cancelClick
    })
  } else if (props.waterData.menuId == 'ys00104') {
    upDatepmz(params).then((res: any) => {
      updateList()
      cancelClick
    })
  } else if (props.waterData.menuId == 'ys00105') {
    upDatexfsy(params).then((res: any) => {
      updateList()
      cancelClick
    })
  } else if (props.waterData.menuId == 'ys00106') {
    upDatezrsy(params).then((res: any) => {
      updateList()
      cancelClick
    })
  } else if (props.waterData.menuId == 'ys00107') {
    upDatxhs(params).then((res: any) => {
      updateList()
      cancelClick
    })
  } else if (props.waterData.menuId == 'ys00108') {
    upDatpms(params).then((res: any) => {
      updateList()
      cancelClick
    })
  } else if (props.waterData.menuId == 'ys00109') {
    upDatgdsp(params).then((res: any) => {
      updateList()
      cancelClick
    })
  } else if (props.waterData.menuId == 'ys00110') {
    upDatgdpmp(params).then((res: any) => {
      updateList()
      cancelClick
    })
  }
  // queryXfbfxxList(item, type)
}

function querysyms() {
  //使用模式字典
  queryZdZdmcInfo({ key: 'syms' }).then((res: any) => {
    symsoptions.value = res
  })
}

function querydlxs() {
  //动力形式字典
  queryZdZdmcInfo({ key: 'dlxs' }).then((res: any) => {
    dllxoptions.value = res
  })
}
function queryblx() {
  //泵类型字典
  queryZdZdmcInfo({ key: 'blx' }).then((res: any) => {
    blxoptions.value = res
  })
}

function querypmblhhxs() {
  //泡沫比例混合器形式字典
  queryZdZdmcInfo({ key: 'pmblhhqxs' }).then((res: any) => {
    pmblhhoptions.value = res
  })
}

//获取企业id
const qyId = computed(() => {
  return chemicalStore.qyInfo.id
})

/** 适配接口返回结果 */
function adapter(response: ResultType) {
  if (response.result.resultCode == '000000') {
    return response.data
  }
  throw new Error()
}
const url = ref('')
const queryXfbfxxInfo = (params?: any) =>
  chemical_server.get(`${url.value}`, { params }).then((res) => adapter(res as any))
function closeClick() {
  clearEditState() //清除标注状态
  emit('closeClick', false)
}
function activeReset() {
  isform.value = false
  activeIndex.value = ''
  switch (props.waterData.orderId) {
    case 1:
      url.value = '/xfsgwxx/insertOrUpdate' //消防水网管
      break
    case 2:
      url.value = 'xfpmgwxx/queryXfpmgwxxInfo' //消防泡沫网管
      break
    case 3:
      url.value = 'xfbfxx/queryXfbfxxInfo' //消防泵房
      break
    case 4:
      url.value = 'pmzxx/queryPmzxxInfo' //泡沫站
      break
    case 5:
      url.value = 'xfsh/queryXfshInfo' //消防水源
      break
    case 6:
      url.value = 'trsy/queryTrsyInfo' //天然水源
      break
    case 7:
      url.value = 'xhs/queryXhsInfo' //消火栓
      break
    case 8:
      url.value = 'pms/queryPmsInfo' //泡沫栓
      break
    case 9:
      url.value = 'xfgdsp/queryXfgdspInfo' //固定水炮
      break
    case 10:
      url.value = 'xfgdpmp/queryXfgdpmpInfo' //固定泡沫炮
      break
    default:
      break
  }
}

const dianweiList = ref()
function clickHandler(item: any) {
  clearEditState() //清除标注状态

  /** 地图要素定位 Strat */
  const overlayArr = ['ys00103', 'ys00104', 'ys00105', 'ys00106']
  const pointArr = ['ys00107', 'ys00108', 'ys00109', 'ys00110']

  if (overlayArr.includes(props.waterData.menuId)) {
    flyToLxOrCjid('overlay', item.cjid)
  } else if (pointArr.includes(props.waterData.menuId)) {
    flyToLxOrCjid('point', item.cjid)
  }
  /** 地图要素定位 End */

  activeIndex.value = item.id
}
function showDialog(item: any, type: any) {
  //记录弹窗类型
  chemicalStore.fireFightingFacilities.dialogType = 'edit'

  isform.value = false
  dianweiList.value = item
  queryXfbfxxList(item, type)
}
function showkdkfk() {
  isform.value = true
}
function cancelClick() {
  isform.value = false
}
//搜索
function searchClick() {
  queryxfssDdList()
}
//获取消防设备打点信息
function queryxfssDdList() {
  isform.value = false
  if (props.waterData.menuId == 'ys00101') {
    getqueryxfsgwdd()
  } else if (props.waterData.menuId == 'ys00102') {
    getqueryxfpmgw()
  } else {
    getqueryxfssDdByQyId()
  }
}

const getqueryxfsgwdd = () => {
  // 查询消防水管网列表数据
  const params = {
    qyid: qyId.value,
    cxmx: inputValue.value ? inputValue.value : '',
  }
  queryxfsgwdd(params).then((res: any) => {
    dataList.value = res
    data.isShow = false
  })
}

const getqueryxfpmgw = () => {
  //查询消防泡沫管网列表数据
  const params = {
    qyid: qyId.value,
    cxmx: inputValue.value ? inputValue.value : '',
  }
  queryxfpmgw(params).then((res: any) => {
    dataList.value = res
    data.isShow = false
  })
}

const menuNameArr = ['消火栓', '泡沫栓', '固定水炮', '固定泡沫炮']
function getqueryxfssDdByQyId() {
  let params
  if (menuNameArr.includes(props.waterData.menuName)) {
    params = {
      bzLx: props.waterData.menuCode ? props.waterData.menuCode : '',
      qyid: qyId.value,
    }
  } else {
    params = {
      bzLx: props.waterData.menuCode ? props.waterData.menuCode : '',
      qyid: qyId.value,
      cxmc: inputValue.value ? inputValue.value : '',
      // jgId:sjszjgTywysbm.sjszjgTywysbm
    }
  }
  queryxfssDdByQyId(params).then((res: any) => {
    dataList.value = res
    if (
      props.waterData.menuName == '消火栓' ||
      props.waterData.menuName == '泡沫栓' ||
      props.waterData.menuName == '固定水炮' ||
      props.waterData.menuName == '固定泡沫炮'
    ) {
      dataList.value = res.map((item: any, index: any) => {
        return {
          ...item,
          searchMc: item.bzmc + ' ' + '-' + ' ' + (index + 1),
        }
      })
      if (inputValue.value == '') {
        filPersons.value = dataList.value
      }
    }
    if (props.waterData.menuName == '消火栓') {
      if (dataList.value.length >= 1) {
        getLastXfs()
      } else {
        lastxfs.value = {}
      }
    } else {
      lastxfs.value = {}
    }
    if (props.waterData.menuName == '泡沫栓') {
      if (dataList.value.length >= 1) {
        getLastPms()
      } else {
        lastpms.value = {}
      }
    } else {
      lastpms.value = {}
    }
    if (props.waterData.menuName == '固定水炮') {
      if (dataList.value.length >= 1) {
        getLastGdsp()
      } else {
        lastgdsp.value = {}
      }
    } else {
      lastgdsp.value = {}
    }
    if (props.waterData.menuName == '固定泡沫炮') {
      if (dataList.value.length >= 1) {
        getLastPmp()
      } else {
        lastgdpmp.value = {}
      }
    } else {
      lastgdpmp.value = {}
    }
    data.isShow = false
  })
}
const lastxfs: any = ref({})
const lastpms: any = ref({})
const lastgdsp: any = ref({})
const lastgdpmp: any = ref({})
const getLastXfs = () => {
  const param = {
    qyid: qyId.value,
  }
  queryXhsLastInfo(param).then((res) => {
    lastxfs.value = res
  })
}
const getLastPms = () => {
  const param = {
    qyid: qyId.value,
  }
  queryPmsLastInfo(param).then((res) => {
    lastpms.value = res
  })
}
const getLastGdsp = () => {
  const param = {
    qyid: qyId.value,
  }
  queryXfgdspLastInfo(param).then((res) => {
    lastgdsp.value = res
  })
}
const getLastPmp = () => {
  const param = {
    qyid: qyId.value,
  }
  queryXfgdpmpLastInfo(param).then((res) => {
    lastgdpmp.value = res
  })
}
const filPersons: any = ref([])
watch(
  () => [inputValue.value, props.waterData.menuName],
  (newVal, oldVal) => {
    if (props.waterData.menuId == 'ys00101') {
      getqueryxfsgwdd()
    } else if (props.waterData.menuId == 'ys00102') {
      getqueryxfpmgw()
    } else if (
      props.waterData.menuName == '消火栓' ||
      props.waterData.menuName == '泡沫栓' ||
      props.waterData.menuName == '固定水炮' ||
      props.waterData.menuName == '固定泡沫炮'
    ) {
      if (inputValue.value != '') {
        filPersons.value = dataList.value.filter(
          (item: any) => item.searchMc.indexOf(inputValue.value) !== -1
        )
      } else {
        filPersons.value = dataList.value
      }
    } else {
      getqueryxfssDdByQyId()
    }
  }
)

function queryXfbfxxList(item: any, type: any) {
  Object.keys(XfbfxxList).map((item) => delete XfbfxxList[item])
  // const params = {
  //   key: item.cjid,
  // };

  if (props.waterData.menuName == '消防水管网') {
    const params = {
      key: item.id,
    }
    isform.value = true
    queryXfsgwxx(params).then((res: any) => {
      XfbfxxList.value = res
      dthhtrthr.value.xfbfxxData = res
    })
  } else if (props.waterData.menuName == '消防泡沫管网') {
    const params = {
      key: item.id,
    }
    isform.value = true
    queryXfpm(params).then((res: any) => {
      dthhtrthr.value.xfbfxxData = res
    })
  } else {
    const params = {
      key: item.cjid,
    }
    isform.value = true
    queryXfbfxxInfo(params).then((res: any) => {
      // res.wzxxbInfo = {
      //   qyid: "0001ec70b3bb77d4d52f039e7ef2f545",
      //   bzmc: " ",
      //   bzlx: item.menuCode,
      //   wzxx: "",
      //   zxjd: "",
      //   zxwd: "",
      //   dibgd: 0,
      //   dingbgd: 0,
      //   id: item.id,
      //   cjid: item.cjid,
      //   bz: "",
      //   sfyx: 1,
      // };
      // if (res.xfbxxInfoList.fzrxxInfo && res.xfbxxInfoList.fzrxxInfo == null) {
      //   res.xfbxxInfoList.fzrxxInfo = {
      //     rymc: '',
      //     ryyddh: '',
      //     ryzbdh: ''
      //   }
      // }

      res.xfbxxInfoList &&
        res.xfbxxInfoList.push({
          bll: null,
          blx: blxoptions.value ? blxoptions.value[0].zddm : '',
          byc: null,
          bz: '',
          cjr: '',
          dlxs: dllxoptions.value ? dllxoptions.value[0].zddm : '',
          syms: symsoptions.value ? symsoptions.value[0].zddm : '',
          gxr: '',
          id: '',
          qyid: item.qyid,
          sfyx: 1,
          xfbfid: item.cjid,
          show: true,
        })

      // res.xfbxxInfoList &&
      //   res.xfbxxInfoList.push({
      //     bll: null,
      //     blx: null,
      //     byc: null,
      //     bz: "",
      //     cjr: "",
      //     dlxs: null,
      //     gxr: "",
      //     id: "",
      //     qyid: item.qyid,
      //     sfyx: 1,
      //     syms: null,
      //     xfbfid: item.cjid,
      //     show: true,
      //   });

      // res.pmjxxInfoList &&
      //   res.pmjxxInfoList.push({
      //     bz: '',
      //     cjr: '',
      //     gxr: '',
      //     pmblhhqxs: null,
      //     pmyjbl: '',
      //     pmzid: item.cjid,
      //     pmzmc: '',
      //     qyid: item.qyid,
      //     sfyx: 1,
      //     zdccrl: null,
      //     show: true,
      //   })

      // res.pmjxxInfoList &&
      //   res.pmjxxInfoList.push({
      //     bz: "",
      //     cjr: "",
      //     gxr: "",
      //     pmblhhqxs: null,
      //     pmyjbl: "",
      //     pmzid: item.cjid,
      //     pmzmc: "",
      //     qyid: item.qyid,
      //     sfyx: 1,
      //     zdccrl: null,
      //     show: true,
      //   }),

      res.pmzbxxInfoList &&
        res.pmzbxxInfoList.push({
          bll: null,
          blx: blxoptions.value ? blxoptions.value[0].zddm : '',
          byc: null,
          bz: '',
          cjr: '',
          dlxs: dllxoptions.value ? dllxoptions.value[0].zddm : '',
          gxr: '',
          pmzid: item.cjid,
          qyid: item.qyid,
          sfyx: 1,
          show: true,
        })

      //   res.pmzbxxInfoList &&
      //   res.pmzbxxInfoList.push({
      //     bll: null,
      //     blx: null,
      //     byc: null,
      //     bz: "",
      //     cjr: "",
      //     dlxs: null,
      //     gxr: "",
      //     pmzid: item.cjid,
      //     qyid: item.qyid,
      //     sfyx: 1,
      //     show: true,
      //   });

      // res.xfbxxInfoList =
      //   res.xfbxxInfoList != null
      //     ? res.xfbxxInfoList
      //     : [
      //       {
      //         bll: null,
      //         blx: null,
      //         byc: null,
      //         bz: "",
      //         cjr: "",
      //         dlxs: null,
      //         gxr: "",
      //         id: "",
      //         qyid: item.qyid,
      //         sfyx: 1,
      //         syms: null,
      //         xfbfid: item.cjid,
      //         show: true,
      //       },
      //     ];

      res.pmjxxInfoList &&
        res.pmjxxInfoList.push({
          bz: '',
          cjr: '',
          gxr: '',
          pmblhhqxs:pmblhhoptions.value ? pmblhhoptions.value[0].zddm : '',
          pmyjbl: '',
          pmzid: item.cjid,
          pmzmc: '',
          qyid: item.qyid,
          sfyx: 1,
          zdccrl: null,
          show: true,
        })

      // res.pmjxxInfoList =
      //   res.pmjxxInfoList != null
      //     ? res.pmjxxInfoList
      //     : [
      //       {
      //         bz: "",
      //         cjr: "",
      //         gxr: "",
      //         pmblhhqxs: null,
      //         pmyjbl: "",
      //         pmzid: item.cjid,
      //         pmzmc: "",
      //         qyid: item.qyid,
      //         sfyx: 1,
      //         zdccrl: null,
      //         show: true,
      //       },
      //     ];
      // res.pmzbxxInfoList =
      //   res.pmzbxxInfoList != null
      //     ? res.pmzbxxInfoList
      //     : [
      //       {
      //         bll: null,
      //         blx: null,
      //         byc: null,
      //         bz: "",
      //         cjr: "",
      //         dlxs: null,
      //         gxr: "",
      //         pmzid: item.cjid,
      //         qyid: item.qyid,
      //         sfyx: 1,
      //         show: true,
      //       },
      //     ];
      // XfbfxxList.value = res;
      // XfbfxxList.value.fzrxxInfo =
      //   XfbfxxList.value.fzrxxInfo != null ? XfbfxxList.value.fzrxxInfo : {};
      nextTick(() => {
        dthhtrthr.value.xfbfxxData = res
        dthhtrthr.value.xfbfxxData.sfyx = 1
        dthhtrthr.value.xfbfxxData.qyid = qyId.value
        if (dthhtrthr.value.xfbfxxData.fzrxxInfo == null) {
          dthhtrthr.value.xfbfxxData.fzrxxInfo = {
            bz: '',
            cjr: '',
            cjsj: '',
            gxr: '',
            gxsj: '',
            id: '',
            qyid: item.qyid,
            rymc: '',
            rysx: 0,
            ryyddh: '',
            ryzbdh: '',
            ryzw: '',
            sfyx: 1,
            ssid: '',
          }
        }
        if (dthhtrthr.value.xfbfxxData.xfbxxInfoList == null) {
          dthhtrthr.value.xfbfxxData.xfbxxInfoList = [
            {
              bll: null,
              blx: null,
              byc: null,
              bz: '',
              cjr: '',
              dlxs: null,
              gxr: '',
              id: '',
              qyid: item.qyid,
              sfyx: 1,
              syms: null,
              xfbfid: item.cjid,
              show: true,
            },
          ]
        }
        if (dthhtrthr.value.xfbfxxData.pmjxxInfoList == null) {
          dthhtrthr.value.xfbfxxData.pmjxxInfoList = [
            {
              bz: '',
              cjr: '',
              gxr: '',
              pmblhhqxs: null,
              pmyjbl: '',
              pmzid: item.cjid,
              pmzmc: '',
              qyid: item.qyid,
              sfyx: 1,
              zdccrl: null,
              show: true,
            },
          ]
        }
        if (dthhtrthr.value.xfbfxxData.pmzbxxInfoList == null) {
          dthhtrthr.value.xfbfxxData.pmzbxxInfoList = [
            {
              bll: null,
              blx: blxoptions.value ? blxoptions.value[0].zddm : '',
              byc: null,
              bz: '',
              cjr: '',
              dlxs: dllxoptions.value ? dllxoptions.value[0].zddm : '',
              gxr: '',
              pmzid: item.cjid,
              qyid: item.qyid,
              sfyx: 1,
              show: true,
            },
          ]
        }
      })
    })
  }
}
function updateList() {
  queryxfssDdList()
}
const delList = {
  消防水管网: '是否确定删除消防水管网的信息',
  消防泡沫管网: '是否确定删除消防泡沫管网的信息',
  消防泵房: '是否确定删除消防泵房以及该消防泵房地图上的信息',
  泡沫站: '是否确定删除泡沫站以及该泡沫站地图上的信息',
  消防水源: '是否确定删除消防水源以及该消防水源地图上的信息',
  天然水源取水点: '是否确定删除天然水源取水点以及该天然水源取水点地图上的信息',
  消火栓: '是否确定删除消火栓以该改消火栓地图上的信息',
  泡沫栓: '是否确定删除泡沫栓以该改泡沫栓地图上的信息',
  固定水炮: '是否确定删除固定水炮以该改固定水炮地图上的信息',
  固定泡沫炮: '是否确定删除固定泡沫炮以该改固定泡沫炮地图上的信息',
}
function removeClick(item: any, type: any) {
  chemicalStore.secondaryConfirmInfo = {
    show: true,
    text: delList[props.waterData.menuName],
    type: 'delData',
    typeCode: props.waterData.menuName,
    data: item,
  }
}
onMounted(() => {
  querysyms()
  querydlxs()
  queryblx()
  querypmblhhxs()
})
defineExpose({ activeReset, queryxfssDdList, showkdkfk })
</script>

<style lang="less" scoped>
.watersource-container {
  width: 100%;
  height: 100%;

  .watersource-main {
    width: 240px;
    height: 100%;
    border: 1px solid #0d609c;
    background: rgba(1, 7, 17, 0.7);
    box-sizing: border-box;

    .w-50 {
      width: 13.7rem;
    }

    /deep/ .el-input--small .el-input__wrapper {
      padding: 1px 7px;
      background-color: #000;
      color: rgba(255, 255, 255, 0.8);
    }

    .xfsgw-item {
      width: 100%;
      height: 50px;
      border-radius: 5px;
      background: rgba(1, 7, 17, 0.8);
      color: rgba(255, 255, 255, 0.8);
      padding: 0 10px;
      line-height: 50px;
      box-sizing: border-box;
      cursor: pointer;
      margin-bottom: 10px;
    }
  }
  .overhidden{
    width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .watersource-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
    padding: 0 15px;
    border-bottom: 1px solid grey;
    font-size: 18px;
    font-weight: 700;
    box-sizing: border-box;

    /deep/.el-icon {
      font-size: 20px;
      cursor: pointer;
      vertical-align: middle;
    }
  }
}

.active-color {
  background-color: rgba(21, 214, 186, 0.3) !important;
}
</style>
